package linc.cool.provider;

import linc.cool.framework.Protocol;
import linc.cool.framework.ProtocolFactory;
import linc.cool.framework.URL;
import linc.cool.framework.register.LocalRegister;
import linc.cool.framework.register.RemoteMapRegister;
import linc.cool.provider.api.HelloService;
import linc.cool.provider.impl.HelloServiceImpl;


/**
 * @author yqlin
 * @date 2022/3/11 4:00 上午
 * @description
 */
public class Provider {
    public static void main(String[] args) {
        // 本地注册
        LocalRegister.register(HelloService.class.getName(), HelloServiceImpl.class);
        // 注册中心注册
        URL url = new URL("localhost", 8080);
        RemoteMapRegister.register(HelloService.class.getName(), url);

        // 启动Tomcat/Netty
        // new NettyServer().start(url);

        // HttpServer
        // new HttpServer().start(url);
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(url);
    }
}
